﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace Garlic.DM.DataModel
{
    [Serializable]
    [Obsolete("please use 'Garlic.Infrustructure.Data.BusinessObject' instead.")]
    public class BaseInfo
    {
        public override string ToString()
        {
            //反射当前对象的属性值，并组合成字符串
            PropertyInfo[] properties = this.GetType().GetProperties();
            if (properties == null || properties.Length <= 0)
                return base.ToString();

            StringBuilder sbStr = new StringBuilder();
            for (int i = 0; i < properties.Length; i++)
            {
                sbStr.Append(properties[i].Name + ":" + properties[i].GetValue(this, null) + ";");
            }
            return sbStr.ToString();
        }
    }
}
